<%@page language="java" contentType="text/html; charset=utf-8"%>
<%@include file="/tagDeclare.jsp"%>
<%@include file="/headDeclare.jsp"%>
<html>
<head>
	<style type="text/css">
		tr{height: 30px;}
		td{margin: 5px;padding: 5px;}
	</style>

	<script type="text/javascript">
	var dialog = frameElement.dialog; //调用页面的dialog对象(ligerui对象)
	  $(document).ready(function(){
		  $.ajaxSetup ({ cache:false,async: false });
		     //异步提交表单
		     var options = {dataType: 'json', beforeSubmit: checkSubmit, success: process};
		     $("#rightForm").submit(function(){
		         $(this).ajaxSubmit(options);
		          return false;
		     }); 
		     
	  });
	  
	  function process(responseJson) {
		     if(responseJson.code == 0) {
		    	 $.ligerDialog.error(responseJson.message);
		         return;
		     }
		     else
		     { 
		    	 window.parent.parent.frames["righttree"].location.reload();
	    		 window.parent.pagerForm.submit();
	    	     dialog.close();
		     }
		   }  
		  
		  function checkSubmit(){
			  var rightName = $("#rightName").val();
			  if(isEmpty(rightName)){
				  $.ligerDialog.alert("权限名称不能为空");
				  $("#rightName").focus();
				  return false;
			  }
			  var rightMark = $("#rightMark").val();
			  if(isEmpty(rightMark)){
				  $.ligerDialog.alert("权限标识不能为空");
				  $("#rightMark").focus();
				  return false;
			  }
			  return true;
		  }
	</script>
</head>
<body>
  <div>
      <form id="rightForm" method="post" action="right/update.do">
      	<input type="hidden" name="id" value="${right.id }" />
      	<input type="hidden" name="upRightId" value="${right.upRightId }" />
        <table>
		    <tr>
			    <td><label for="town">权限名称：</label></td>
				<td>
				   <input type="text" name="rightName" id="rightName" value="${right.rightName }" class="ldText" />
				</td>
			</tr>
			<tr>
			    <td><label for="rightMark">权限标识：</label></td>
				<td>
				   <input type="text" name="rightMark" id="rightMark" value="${right.rightMark }" class="ldText" />
				</td>
			</tr>
			<tr>
			    <td><label for="password2">权限URL：</label></td>
				<td>
				   <input type="text" name="rightUrl" id="rightUrl" value="${right.rightUrl }" class="ldText"  />
				</td>
			</tr>
        </table>
      </form>
    </div>
</body>
</html>